﻿using Microsoft.EnterpriseSingleSignOn.Interop;
using System;
using System.Collections.Specialized;

namespace BizTalk.ESB.Extensions.SSO.Common
{
    public class SsoPropertyBag : IPropertyBag
    {
        public HybridDictionary properties;

        public SsoPropertyBag()
        {
            properties = new HybridDictionary();
        }

        public bool Contains(string key)
        {
            return properties.Contains(key);
        }

        public void Remove(string key)
        {
            properties.Remove(key);
        }

        #region IPropertyBag Members

        public void Read(string propName, out object ptrVar, int errorLog)
        {
            ptrVar = properties[propName];
        }

        public void Write(string propName, ref object ptrVar)
        {
            properties.Add(propName, ptrVar);
        }

        public int PropertyCount
        {
            get
            {
                return properties.Count;
            }
        }

        #endregion
    }
}
